package com.sky.mapper;


import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据用户openid查询用户信息
     *
     * @param openid
     * @return
     */
    @Select("select * from ZJP2025.user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 插入新用户数据
     * @param user
     */
    
    void insert(User user);

    /**
     * 查询订单支付用户id
     * @param userId
     * @return
     */
    @Select("select * from ZJP2025.user where id = #{id}")
    User getById(Long userId);

    /**
     * 根据动态条件统计用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
